﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace EOSCRM.Web.Common
{
    public class NewPageRDLC
    {
        int offset;
        Object newpage;
        Object currentGroup;
        Object currentGroup2;
        Object currentGroup3;
        public int GetGroupPageNumber(ref Boolean NewPage, ref int PageNumber)
        {
            if (NewPage) offset = PageNumber - 1;
            return PageNumber - offset;
        }
        public Boolean IsNewPage(ref Object group1, ref Object group2, ref Object group3)
        {
            newpage = false;
            if (group1 != currentGroup)
            {
                newpage = true;
                currentGroup = group1;
            }
            else if (group2 != currentGroup2)
            {
                newpage = true;
                currentGroup2 = group2;
            }
            else if (group3!= currentGroup3)
            {
                newpage = true;
                currentGroup3 = group3;
            }
            return (Boolean)newpage;
        }
    }
}